package com.fashion.model.gallery;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import java.util.Date;

import javax.persistence.*;

@Entity
@Table(name="FASHION.GA_PHOTO")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Photo {
	@Column(name="NAME")
	private String name;
	@Id
	@Column(name="ID", updatable=false)
	private String id;
	@ManyToOne( targetEntity=Album.class, fetch=FetchType.LAZY )
    @JoinColumn(name="ALBUM_ID")
	private Album album;
	@Column(name="DATE")
	private Date date;

    @Transient
    private boolean vertical;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Album getAlbum() {
		return album;
	}

	public void setAlbum(Album album) {
		this.album = album;
	}

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }


    public boolean isVertical() {
        return vertical;
    }

    public void setVertical(boolean vertical) {
        this.vertical = vertical;
    }
}
